package cn.yuanqiao.archive.storeRoom.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.List;

/**
 * 库房权限对象 YQSTOREROLE
 * 
 * @author xy
 * @date 2023-06-20
 */
public class StoreRole extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    private final String BIGTABLENAME = "_YQSTOREROLE";

    public StoreRole() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            //throw new ServiceException("tenantCode is null");
            this.tableName="YQSTOREROLE";
        }else {
            this.tableName = tenantCode+BIGTABLENAME;
        }
    }

    /** 库房Id */
    @Excel(name = "库房Id")
    private Long storeId;

    /** 用户Id */
    @Excel(name = "用户Id")
    private Long userId;

    private String tableName;

    private String storeName;


    private String userName;

    private List<Long> userIds;
    public void setStoreId(Long storeId) 
    {
        this.storeId = storeId;
    }

    public Long getStoreId() 
    {
        return storeId;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }


    public List<Long> getUserIds() {
        return userIds;
    }

    public void setUserIds(List<Long> userIds) {
        this.userIds = userIds;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("storeId", getStoreId())
            .append("userId", getUserId())
            .append("tableName", getTableName())
            .append("storeName", getStoreName())
            .toString();
    }
}
